package com.java.web.service.impl;


import com.java.web.model.WebMenuEntity;
import com.java.web.service.WebMenuService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

/**
 * 员工业务层测试类
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class WebMenuServiceTest {


    @Autowired
    private WebMenuService webMenuService;

    //日志对象
    private static final Logger log= (Logger) Logger.getLogger(String.valueOf(WebMenuServiceTest.class));


    @Test
    public void test01(){
        WebMenuEntity paramMenu=new WebMenuEntity();
        try {
            Map<String,Object>map=webMenuService.findListByPramas(1,3,paramMenu);
            System.out.println("总的数据条数"+map.get("count"));
            List<WebMenuEntity>menus= (List<WebMenuEntity>) map.get("data");
            for (WebMenuEntity menuEntity:menus){
                System.out.println(menuEntity);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
